<html>
<head><meta charset="utf-8"><title>Adding a custom final optimization pass? · t-compiler/wg-llvm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/index.html">t-compiler/wg-llvm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Adding.20a.20custom.20final.20optimization.20pass.3F.html">Adding a custom final optimization pass?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205189792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Adding%20a%20custom%20final%20optimization%20pass%3F/near/205189792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Adding.20a.20custom.20final.20optimization.20pass.3F.html#205189792">(Jul 28 2020 at 02:18)</a>:</h4>
<p>Hello, where would I need to look in order to add a final custom pass into rustc's LLVM codegen?</p>



<a name="205238929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Adding%20a%20custom%20final%20optimization%20pass%3F/near/205238929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Adding.20a.20custom.20final.20optimization.20pass.3F.html#205238929">(Jul 28 2020 at 14:02)</a>:</h4>
<blockquote>
<p>The -Cpasses=val option allows you to supply a space separated list of extra LLVM passes to run</p>
</blockquote>



<a name="205238937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Adding%20a%20custom%20final%20optimization%20pass%3F/near/205238937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Adding.20a.20custom.20final.20optimization.20pass.3F.html#205238937">(Jul 28 2020 at 14:02)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/backend/debugging.html#compiler-options-to-know-and-love">https://rustc-dev-guide.rust-lang.org/backend/debugging.html#compiler-options-to-know-and-love</a></p>



<a name="205269671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Adding%20a%20custom%20final%20optimization%20pass%3F/near/205269671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Adding.20a.20custom.20final.20optimization.20pass.3F.html#205269671">(Jul 28 2020 at 18:03)</a>:</h4>
<p>Is it possible to code a custom pass in Rust?</p>



<a name="205270303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Adding%20a%20custom%20final%20optimization%20pass%3F/near/205270303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Adding.20a.20custom.20final.20optimization.20pass.3F.html#205270303">(Jul 28 2020 at 18:09)</a>:</h4>
<p>Not practical. There's too many C+++ APIs that you need to interact with that don't have bindings and would be hard to funnel through a C API.</p>



<a name="205270323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Adding%20a%20custom%20final%20optimization%20pass%3F/near/205270323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Adding.20a.20custom.20final.20optimization.20pass.3F.html#205270323">(Jul 28 2020 at 18:09)</a>:</h4>
<p>ah, alright. thanks</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>